package fr.vvins.core.biz.user;

import java.util.List;
import java.util.Map;

import fr.vvins.core.biz.user.dto.CredentialDto;
import fr.vvins.core.biz.user.dto.FavoriteDto;
import fr.vvins.core.biz.user.dto.UserCommentDto;
import fr.vvins.core.biz.user.dto.UserCommunityDto;
import fr.vvins.core.biz.user.dto.UserContactDto;
import fr.vvins.core.biz.user.dto.UserDto;
import fr.vvins.core.biz.user.dto.UserDtoInfo;
import fr.vvins.core.biz.user.dto.UserLogDto;
import fr.vvins.core.common.TechnicalException;

public interface UserManager {
	
	public Integer decrypt(String token) throws TechnicalException, UserException;
	
	public String crypt(Integer userId) throws TechnicalException, UserException;
	
	public UserDto authenticate(CredentialDto dto) throws TechnicalException, UserException;
	
	public UserDto createUser(UserDto dto) throws TechnicalException, UserException;
	
	public UserDto updateUser(Integer userId, Map<String, String> property) throws TechnicalException, UserException;

	public void addLog(Integer id, String entity, Integer entityId, Integer actionId) throws TechnicalException, UserException;

	public List<UserLogDto> getLastLog(Integer userId) throws TechnicalException, UserException;

	public void addFavorite(Integer userId, String entity, Integer entityId) throws TechnicalException, UserException;

	public List<FavoriteDto> getFavorites(Integer id) throws TechnicalException, UserException;
	
	public UserDtoInfo findUserInfoById(Integer userId) throws TechnicalException, UserException;
	
	public UserDto findUserById(Integer userId) throws TechnicalException, UserException;
	
	public UserDto findUserByLogin(String login) throws TechnicalException, UserException;
	
	public UserDto findUserByCommunityToken(String token) throws TechnicalException, UserException;

	public List<UserDtoInfo> findUsersByCommunityToken(List<String> token) throws TechnicalException, UserException;
	
	public List<FavoriteDto> getUserFavorites(Integer userId, Integer targetUserId) throws TechnicalException, UserException;

	public void removeFavorite(Integer userId, String entity, Integer entityId) throws TechnicalException, UserException;

	public void addFollowing(Integer userId, Integer targetUserId) throws TechnicalException, UserException;

	public void addFollowings(Integer userId, List<Integer> targetUsersId) throws TechnicalException, UserException;
	
	public List<UserDtoInfo> getUserFollowers(Integer userId, Integer targetUserId) throws TechnicalException, UserException;

	public List<UserDtoInfo> getUserFollowing(Integer userId, Integer targetUserId) throws TechnicalException, UserException;
	
	public void removeFollowing(Integer userId, Integer targetUserId) throws TechnicalException, UserException;

	public void addContactInfo(Integer userId, UserContactDto contact)  throws TechnicalException, UserException;

	public List<UserContactDto> getContactInfo(Integer userId) throws TechnicalException, UserException;

	public void updateContactInfo(Integer tokenUserId, Map<String, String> properties) throws TechnicalException, UserException;

	public List<UserCommentDto> getUserComments(Integer userId, Integer targetUserId) throws TechnicalException, UserException;

	public List<UserCommentDto> getComments(Integer userId) throws TechnicalException, UserException;

	public List<UserDtoInfo> getFollowers(Integer userId) throws TechnicalException, UserException;

	public List<UserDtoInfo> getFollowing(Integer userId) throws TechnicalException, UserException;

	public void addUserCommunity(Integer userId, UserCommunityDto community) throws TechnicalException, UserException;

	public UserDto findUserByEmail(String email) throws TechnicalException, UserException;	
	
}
